<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.9.1.js"></script>
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/css/main.css" type="text/css" />
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript">
function deleteByAdminOrder(id) {
	$.post("http://localhost:7788/hotel2.0/admin/deleteByAdminOrder",{"id":id},function(data){
		if (data == "ok") {
			alert("删除成功");
			window.location.reload();
		}else {
			alert("删除失败");
			window.location.reload();
		}
	}
	);
}
</script>
</head>
<body style="background-color: #23262E">
	<%@include file="head.jsp"%>
	<div class="dddiv"
		style="background-color: #F2F2F2;width: 1501px;height: 800px;margin-left: auto;margin-right: auto;left: 9px;">
		<div class="dadiv" style="top: 20px;width: 1100px;">
			<div class="divbody" style="width: 1100px;left: 0px;">
				<form id="userAction_save_do" name="Form1"
					action="${pageContext.request.contextPath}/admin/findByAdminOrder" method="post">
					<table cellSpacing="1" cellPadding="5" width="100%" align="center"
						bgColor="#eeeeee" style="border: 1px solid #8ba7e3" border="0">
						<tr>
							<td class="ta_01" align="center" bgColor="#23262E" colSpan="10"
								height="26" style="color: #F2F2F2"><strong><STRONG>订单管理</STRONG>
							</strong></td>
						</tr>

						<tr>
							<td align="center" bgColor="#f5fafe" class="ta_01">姓名：</td>
							<td class="ta_01" bgColor="#ffffff"><input type="text"
								name="name" class="bg" /></td>

							<td align="center" bgColor="#f5fafe" class="ta_01"
								style="width: 166px">身份证号：</td>
							<td class="ta_01" bgColor="#ffffff" style="width: 360px"><input
								type="text" name="number" class="bg" /></td>
							<td align="center" bgColor="#f5fafe" class="ta_01">房间号：</td>
							<td class="ta_01" bgColor="#ffffff"><input type="number"
								name="prid" class="bg" /></td>
						</tr>
					</table>
					<table cellpadding="0" cellspacing="0" border="0" width="100%">
						<tr>
							<td align="right" bgColor="#ffffff" class="ta_01"><br />
							<br /></td>
							<td align="center" bgColor="#ffffff" class="ta_01">
								<button type="submit" id="search" name="search"
									value="&#26597;&#35810;" class="button_view">
									&#26597;&#35810;</button> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input
								type="reset" name="reset" value="&#37325;&#32622;"
								class="button_view" />
							</td>
						</tr>
					</table>

					<table cellspacing="0" cellpadding="1" rules="all"
						bordercolor="gray" border="1" id="DataGrid1"
						style="BORDER-RIGHT: gray 1px solid; BORDER-TOP: gray 1px solid; BORDER-LEFT: gray 1px solid; WIDTH: 100%; WORD-BREAK: break-all; BORDER-BOTTOM: gray 1px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #f5fafe; WORD-WRAP: break-word">
						<tr
							style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; HEIGHT: 25px; BACKGROUND-COLOR: #23262E; color: #F2F2F2">
							<td align="center" width="6%">订单号</td>
							<td align="center" width="9%">姓名</td>
							<td align="center" width="18%">身份证号</td>
							<td width="12%" align="center">电话号</td>
							<td width="12%" align="center">用户名</td>
							<td width="6%" align="center">房间号</td>
							<td width="6%" align="center">删除</td>
						</tr>
						<c:forEach items="${orders}" var="o">
							<tr onmouseover="this.style.backgroundColor = 'white'"
								onmouseout="this.style.backgroundColor = '#F5FAFE';">
								<td style="CURSOR: hand; HEIGHT: 22px" align="center"
									width="200">${o.orid }</td>
								<td style="CURSOR: hand; HEIGHT: 22px" align="center"
									width="200">${o.name }</td>
								<td style="CURSOR: hand; HEIGHT: 22px" align="center"
									width="200">${o.number }</td>
								<td style="CURSOR: hand; HEIGHT: 22px" align="center"
									width="200">${o.tel }</td>
								<td style="CURSOR: hand; HEIGHT: 22px" align="center"
									width="200">${o.user.username }</td>
								<td style="CURSOR: hand; HEIGHT: 22px" align="center"
									width="200">${o.product.roomnumber }</td>
								<td align="center">
								<a href="#"  onclick="deleteByAdminOrder(${o.orid})" id="delete_b" class="button_view">删除</a></td>
							</tr>
						</c:forEach>
					</table>

				</form>
			</div>
		</div>
	</div>
</body>
</html>